package com.tvb.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.tvb.dao.LoginRoleDao;
import com.tvb.dao.LoginUserDao;
import com.tvb.pojo.LoginRole;
import com.tvb.pojo.LoginUser;
import com.tvb.service.UserRoleService;

@Service("userRoleService")
public class UserRoleServiceImpl implements UserRoleService {
	@Autowired
	private LoginUserDao loginUserDao;
	
	@Autowired
	private LoginRoleDao loginRoleDao;

	public List<LoginUser> findUserList() throws Exception{
		// TODO Auto-generated method stub
		return loginUserDao.findUserList();
	}


	public LoginUser findByName(String name) throws Exception {
		// TODO Auto-generated method stub
		return loginUserDao.findByAccount(name);
	}


	public List<LoginRole> findAllRoleViews() throws Exception {
		// TODO Auto-generated method stub
		return loginRoleDao.findAllRoleViews();
	}


	@Transactional(readOnly = false)
	public void saveUser(LoginUser user) throws Exception {
		// TODO Auto-generated method stub
		loginUserDao.saveUser(user);
	}

}
